package com.steven.concurrency.example.publish;

import com.sun.org.apache.bcel.internal.classfile.InnerClass;
import lombok.extern.slf4j.Slf4j;

/**
 * 对象在没有完成构造之前其中的属性就已经被线程可见了
 */
@Slf4j
public class Escape {

    public int thiscanBeescape=0;

    public Escape(){
        new InnerClass();
    }

    private  class InnerClass{
        private InnerClass(){
            log.info("{}",Escape.this.thiscanBeescape);
        }
    }

    public static void main(String[] args) {
        Escape escape =new Escape();
    }

}
